{% extends "base_generic.html" %}

{% block content %}
  <h1>作者: {{ author }}</h1>
  <p>{{ author.date_of_birth }} - {% if author.date_of_death %}{{ author.date_of_death }}{% endif %}</p>

  <div style="margin-left:20px;margin-top:20px">
    <h4>作品</h4>

    {% for book in author.book_set.all %}
    <hr>
    <p><strong><a href="{{ book.get_absolute_url }}">{{ book.title }}</a></strong></p>
    <p>{{ book.summary }}</p>
    {% endfor %}
  </div>

  {% if perms.catalog.can_mark_returned %}
    <hr>
    <p>
      <a href="{% url 'author-update' author.pk %}" class="btn btn-warning">更新</a>
      <a href="{% url 'author-delete' author.pk %}" class="btn btn-danger">删除</a>
    </p>
  {% endif %}
{% endblock %} 